package com.wuye.model.customer;

import com.wuye.web.Constant;
import org.apache.commons.lang3.builder.ReflectionToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;

/**
 * Created by zhanchi on 2016/7/1.
 */
@Entity
@Table(name="wuye_optionPoll")
public class OptionPoll implements Serializable{
    @Id
    @Column(name="wuye_optionPoll_id")
    private Integer pollId;
    @Column(name="wuye_optionPoll_name")
    private String pollName;
    @Temporal(TemporalType.TIMESTAMP)
    @Column(name="wuye_optionPoll_createTime")
    private Date endTime;



    public String toString() {
        try {
            return ReflectionToStringBuilder.toString(this, ToStringStyle.MULTI_LINE_STYLE);
        } catch (Exception e) {
            return e.getMessage();
        }
    }
    public OptionPoll() {
    }

    public OptionPoll(Integer pollId, String pollName, Date endTime) {
        this.pollId = pollId;
        this.pollName = pollName;
        this.endTime = endTime;
    }

    public Integer getPollId() {
        return pollId;
    }

    public void setPollId(Integer pollId) {
        this.pollId = pollId;
    }

    public String getPollName() {
        return pollName;
    }

    public void setPollName(String pollName) {
        this.pollName = pollName;
    }

    public String getEndTime() {

        return Constant.sdfDay.format(endTime);
    }

    public void setEndTime(Date endTime) {
        this.endTime = endTime;
    }
}
